<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="xml"/>
	<!--html2wml.xsl For translating XHTML to WML                      -->
	<!--Copyright (C) 2001  Paul Howard paul@paulhoward.co.uk          -->
	<!--This program is free software; you can redistribute it and/or  -->
	<!--modify it under the terms of the GNU General Public License    -->
	<!--as published by the Free Software Foundation; either version 2 -->
	<!--of the License, or (at your option) any later version.         -->
	<!--This program is distributed in the hope that it will be useful,-->
	<!--but WITHOUT ANY WARRANTY; without even the implied warranty of -->
	<!--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  -->
	<!--GNU General Public License for more details.                   -->
	<xsl:variable name="chosenURL">
		<!--Global variable for passing selected URL to card-->
		<xsl:value-of select="@href"/>
	</xsl:variable>
	<xsl:template match="html">
		<!--Template match check for <html> tag-->
		<xsl:text disable-output-escaping="yes">
			&lt;!DOCTYPE wml PUBLIC '-//WAPFORUM//DTD WML 1.2//EN'		<!--WML preamble-->
			'http://www.wapforum.org/DTD/wml_1.2.xml' >
	  </xsl:text>
		
	</xsl:template>
	<xsl:template match="script"/>
	<xsl:template match="head"/>
	<xsl:template match="body">
		<xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="frameset">
		<p align="center">
			<b>Frames found</b>
		</p>
		<p align="center">
			<b>please select...</b>
		</p>
		<!--Head of a Frame presenting card-->
		<xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="frame">
		<!--Option to select a frame-->
		<xsl:for-each select=".">
			<p>Goto:<a href="#card2">
					<xsl:value-of select="@name"/>
				</a>
			</p>
		</xsl:for-each>
		<xsl:for-each select=".">
			<xsl:variable name="chosenSRC">
				<!--Variable instantiated for the frame's name-->
				<xsl:value-of select="@src"/>
			</xsl:variable>
			<xsl:variable name="hyperlink">
				<!--Variable instantiated for the URL frame refers to-->
				<xsl:value-of select="card2"/>
			</xsl:variable>
		</xsl:for-each>
	</xsl:template>
	<xsl:template match="noframes">
		<!--Tests for parental nodes, are we in a p tag if not, create one-->
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="h1">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="h2">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="h3">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="h4">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="h5">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="h6">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="p[.='&#160;']">
		<!--Template for handling '&nbsp' paragraphs-->
		<xsl:variable name="alignment">
			<!--Variable to see how source is aligned-->
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$alignment='center'">
			<!--Check for alignment followed by the parental check-->
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p align="center"/>
					<!--Creates a centrally aligned empty paragraph-->
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='middle'">
			<!--Check for middle alignment followed by the parental check-->
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p align="right"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p align="left"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="div[.='&#160;']">
		<!--Template for empty div tags-->
		<xsl:variable name="alignment">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$alignment='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p align="center"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='middle'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p align="right"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p align="left"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="td[.='&#160;']">
		<!--Template for empty table data  -->
		<xsl:variable name="alignment">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$alignment='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p align="center"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='middle'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p align="right"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p align="left"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
	    </xsl:when>
				<xsl:otherwise>
					<p/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="p">
		<!--p tag template-->
		<xsl:variable name="alignment">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$alignment='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='middle'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="right">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="left">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p>
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="center">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p align="center">
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="pre">
		<!--pre handler that can also dictate alignment-->
		<xsl:variable name="alignment">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$alignment='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='middle'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="right">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="left">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p>
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="address">
		<!--address template handler-->
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="table">
		<!--table template handler-->
		<xsl:variable name="alignment">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$alignment='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='middle'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="right">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="left">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p>
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="tbody">
		<!--table body handler that can take alignment attributes-->
		<xsl:variable name="alignment">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$alignment='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='middle'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="right">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="left">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p>
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="th">
		<xsl:variable name="alignment">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$alignment='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='middle'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="right">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="left">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p>
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="dt">
		<xsl:variable name="alignment">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$alignment='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='middle'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="right">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="left">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p>
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="dd">
		<xsl:variable name="alignment">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$alignment='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='middle'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="right">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="left">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p>
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="td">
		<xsl:variable name="lineup">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$lineup='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$lineup='middle'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$lineup='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="right">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$lineup='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="left">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$lineup=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p>
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="tr">
		<xsl:variable name="lineup">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$lineup='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$lineup='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="right">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$lineup='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="left">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$lineup=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p>
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="li">
		<xsl:variable name="alignment">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$alignment='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="right">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="left">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$alignment=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p>
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="div">
		<xsl:variable name="lineup">
			<xsl:value-of select="@align"/>
		</xsl:variable>
		<xsl:if test="$lineup='center'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="center">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$lineup='right'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="right">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$lineup='left'">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p align="left">
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
		<xsl:if test="$lineup=''">
			<xsl:choose>
				<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<p>
						<xsl:apply-templates/>
					</p>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	<xsl:template match="u">
		<!--No styles necessary but u will now be recognised as a parental node-->
		<xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="ul">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="font">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="blockquote">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="small">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="big">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="layer">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="ilayer">
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="strong">
		<xsl:choose>
			<xsl:when test="ancestor::a">
				<!--WML does not allow a b tag to be made in an a tag, so we check all its full ancestory-->
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:when test="parent::a">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<b>
					<xsl:apply-templates/>
				</b>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<b>
						<xsl:apply-templates/>
					</b>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="em">
		<!--WML does not allow an i tag to be made within itself or an a tag, so we check its full ancestory-->
		<xsl:choose>
			<xsl:when test="ancestor::a">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:when test="parent::a">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:when test="ancestor::em">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:when test="parent::a">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<i>
					<xsl:apply-templates/>
				</i>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<i>
						<xsl:apply-templates/>
					</i>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="form">
		<!--Form template which could be expanded to present WML forms-->
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::a or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p>
					<xsl:apply-templates/>
				</p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="a">
		<!--The a match template-->
		<xsl:choose>
			<xsl:when test="parent::big or parent::sup or parent::td or parent::noscript or parent::form or parent::center or parent::table or parent::tbody or parent::td or parent::th or parent::blockquote or parent::ul or parent::font or parent::strong or parent:: em or parent::p or parent::li or parent::pre or parent::div or parent::h1 or parent::h2 or parent::h3 or parent::h4 or parent::h5 or parent::h6 or parent::frameset or parent::th or parent::iframe or parent::span or parent::tt or parent::dt or parent::dd or parent::tr or parent::ol or parent::address or parent::nobr">
				
			</xsl:when>
			<xsl:when test="parent::a">
				<!--A check to make sure an a node isnt nested in itself-->
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="img">
		<!--img presents the src for an image if the image is a link ie. has parent::p-->
		<xsl:choose>
			<xsl:when test="parent::a">
				<xsl:value-of select="@src"/>
			</xsl:when>
			<xsl:otherwise>
	    </xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>
